package com.csun.dsms.service.impl;

import com.csun.dsms.comment.core.support.BaseService;
import com.csun.dsms.mapper.YcAlertMapper;
import com.csun.dsms.model.domain.YcAlert;
import com.csun.dsms.model.dto.yc.YcDeviceQueryDto;
import com.csun.dsms.service.YcAlertService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class YcAlertServiceImpl extends BaseService<YcAlert> implements YcAlertService {

    @Resource
    private YcAlertMapper ycAlertMapper;


    @Override
    public Integer addAlert(YcAlert ycAlert) {
        return ycAlertMapper.insert(ycAlert);
    }

    @Override
    public List<YcAlert> query(YcDeviceQueryDto ycDeviceQueryDto) {
        return ycAlertMapper.queryListWithPage(ycDeviceQueryDto);
    }

    @Override
    public Integer readAlert(YcAlert ycAlert) {
        return ycAlertMapper.readAlert(ycAlert.getId());
    }
}
